home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #1 / Amiga Plus 1998 #1.iso / demo-versionen / haage&partner / warpup-warpos / source / tools / dbreak.p < prev    next >
Text File  |  1997-09-24  |  3KB  |  103 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.  
  4. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  5. **           All Rights Reserved
  6.  
  7.                 include powerpc/ppcmacros.i
  8.                 include powerpc/powerpc.i
  9.  
  10.                 include powerpc_lib.i
  11.                 include exec_lib.i
  12.                 include dos_lib.i
  13.  
  14.                 xref    _SysBase
  15.                 xref    _DOSBase
  16.                 xref    _PowerPCBase
  17.                 xref    _LinkerDB
  18.                 smalldata
  19.                 executable
  20.                 escapestr
  21.                 version 9
  22.  
  23. start
  24.                 prolog  1024
  25.                 push    r31
  26.                 la      _d1,template
  27.                 la      _d2,Array
  28.                 li      _d3,0
  29.                 RUN68K_XL       _DOSBase,ReadArgs
  30.                 tstw    _d0
  31.                 beq     .close
  32.                 mr      r31,_d0
  33.                 lw      r3,Array
  34.                 tstw    r3
  35.                 beq     .clear
  36.                 lbz     r4,0(r3)
  37.                 li      r5,0
  38.                 cmplwi  r4,"$"
  39.                 bne     .loop
  40.                 addi    r3,r3,1
  41. .loop
  42.                 lbz     r4,0(r3)
  43.                 tstw    r4
  44.                 beq     .done
  45.                 slwi    r5,r5,4
  46.                 cmplwi  r4,"0"
  47.                 blt     .letter
  48.                 cmplwi  r4,"9"
  49.                 ble     .number
  50. .letter
  51.                 bitclr  r4,31-5
  52.                 subi    r4,r4,("A"-10)
  53.                 b       .cont
  54. .number
  55.                 subi    r4,r4,"0"
  56. .cont
  57.                 add     r5,r5,r4
  58.                 addi    r3,r3,1
  59.                 b       .loop
  60. .done
  61.                 sw      r5,Args
  62.                 li      r4,HW_SETDBREAK
  63.                 CALLPOWERPC     SetHardware
  64.                 cmplwi  r3,HW_NOTAVAILABLE
  65.                 beq     .notavailable
  66.                 la      _d1,setbreak
  67.                 la      _d2,Args
  68.                 RUN68K_XL       _DOSBase,VPrintf
  69.                 b       .free
  70. .clear
  71.                 li      r4,HW_CLEARDBREAK
  72.                 CALLPOWERPC     SetHardware
  73.                 cmplwi  r3,HW_NOTAVAILABLE
  74.                 beq     .notavailable
  75.                 la      _d1,clearbreak
  76.                 la      _d2,Args
  77.                 RUN68K_XL       _DOSBase,VPrintf
  78.                 b       .free
  79. .notavailable
  80.                 la      _d1,notavailable
  81.                 la      _d2,Args
  82.                 RUN68K_XL       _DOSBase,VPrintf
  83. .free
  84.                 mr      _d1,r31
  85.                 RUN68K_XL       _DOSBase,FreeArgs
  86. .close
  87.                 pop     r31
  88.                 epilog
  89.  
  90.                 section data
  91. template        dc.b    "ADDRESS",0
  92. setbreak        dc.b    "data breakpoint set at %08lx\n",0
  93. clearbreak      dc.b    "data breakpoint cleared\n",0
  94. notavailable    dc.b    "data breakpoint not available on this CPU\n",0
  95.  
  96.                 section bss
  97.                 ds.b    32
  98. Array           ds.l    1
  99. Address         ds.l    1
  100. Args            ds.l    1
  101.                 ds.b    32
  102.                 even
  103.